	<div id="hilight">
		<div class="cycleElementsContainer" id="slider">
			<div class="slider">
				<ul>
					<li>
						<a href="http://activity.you2play.com/archives/29282-แจกบัตรเข้างาน-you2play-awards-2014-งานประกาศผลรางวัลทางดนตรีแห่งปี" target="_blank">
							<?php echo image_asset($asset_award_upload_path.'hilight_01.jpg','',array('width' => 1156,'height' => 465));?>
						</a>
					</li>
					<li>
						<a href="http://activity.you2play.com/archives/29283-neon-circus-competition-แปลงโฉมกันให้จี๊ดด" target="_blank">
							<?php echo image_asset($asset_award_upload_path.'hilight_02.jpg','',array('width' => 1156,'height' => 465));?>
						</a>
					</li>												
				</ul>
			</div>
			<div class="navigation">
				<a href="#" class="cycleToPoint red active" data-position="1"></a>
				<a href="#" class="cycleToPoint red" data-position="2"></a>
			</div>		
		</div>	
	</div>
	<br />
	<div id="artist">
		<div class="left" <?php echo 'style="background-color:'.$dataCategoryColor[intval($this->uri->segment(2))].';"';?>>
			<?php echo image_asset($asset_award_image_path.'/artist_header.png','',array('width' => 380,'height' => 124));?>
			<div class="image">
				<?php echo image_asset($folder_path.'/artist_left_panel.jpg','',array('width' => 185,'height' => 185));?>
			</div>
			<h2><?php echo $dataXML->left_title;?></h2>
			<h3>เพลง <?php echo $dataXML->left_song;?></h3>
			<h4>สังกัด <?php echo $dataXML->left_record;?></h4>
			<p><?php echo $dataXML->left_detail;?></p>
			<?php if($this->expireActivity < time()):?>
				<a class="buttonClosed">ปิดโหวต</a>
			<?php else:?>
				<a href="javascript:void(0);" <?php echo ($is_vote == 0 ? 'class="buttonVote"':'class="buttonVoted"');?> onclick="javascript:voteCat(this,'<?php echo $this->uri->rsegment(3);?>','<?php echo intval($this->uri->rsegment(4));?>');"></a>			
			<?php endif;?>		
		</div>
		<div class="right" <?php echo 'style="background-color:'.$dataCategoryColor[intval($this->uri->segment(2))].';"';?>>
			<h2><?php echo $dataCategory[''.$this->uri->rsegment(3).''];?></h2>
			<!--Vdo Player-->
			<div id="artist_video_player">
				<div id="vdoPlayer">
					<?php if($this->agent->is_mobile()):?>
						<video id='my_video' controls preload='none'></video>
					<?php endif;?>
				</div>			
			</div>
			<!--Social Nav-->
			<div id="socialNav">
				<div class="floatLeft">
					<div class="fb-like" data-href="<?php echo $award_url.$asset_award_artis_path.$this->uri->segment(2).'/'.$this->uri->segment(3);?>" colorscheme="dark" data-show-faces="false" data-share="false" data-show-faces="false" data-layout="button_count"></div>
				</div>
				<div class="floatRight">
					<a href="https://twitter.com/share" class="twitter-share-button" data-lang="th">ทวีต</a>
					<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
				</div>				
				<div class="floatRight">
					<div class="fb-share-button" data-href="<?php echo $award_url.$asset_award_artis_path.$this->uri->segment(2).'/'.$this->uri->segment(3);?>" data-type="button"></div>
				</div>
			</div>
			<div id="artist_video_related">
				<a href="javascript:void(0);" onclick="javascript:playThis('<?php echo image_asset_url($folder_path.'/mv.mp4');?>');">
					<?php echo image_asset($folder_path.'/artist_right_mv.jpg','',array('width' => 140,'height' => 90));?>
					<div class="description">
						<h3><?php echo $dataXML->right_mv_title;?></h3>
						<p><?php echo $dataXML->right_mv_subtitle;?></p>
					</div>
				</a>			
			</div>
			<center><a href="<?php echo $award_url."ment";?>"><?php echo image_asset($asset_award_image_path.'banner_ment.png','',array('width' => 640,'height' => 103));?></a></center>
			<!--Comment Facebook Plugin-->
			<div id="artist_comment">
				<div class="fb-comments" data-href="<?php echo $award_url.$asset_award_artis_path.$this->uri->rsegment(3).'/'.$this->uri->rsegment(4);?>" data-width="640" data-num-posts="20"></div>
			</div>					
		</div>
	</div>
<script type="text/javascript" language="javascript">
(function($) {
/*whatever jQuery stuff*/
	$(function(){
		var is_mobile = '<?php echo $this->agent->is_mobile();?>';
		var url = "<?php echo image_asset_url($folder_path.'/mv.mp4');?>";
		if(is_mobile){
			//Set Video Source
			$('#my_video').append("<source id='mp4' src='"+url+"' type='video/mp4'>");
			$('#my_video').attr('src',""+url+"");
			$('#my_video').attr('width',640);
			$('#my_video').attr('height',390);
			// videoplaza sdk, 4 sec time-out, callback function
			loadScript("<?php echo js_asset_url('media/html5-sdk-1.0.12.15.1-ea.min.js');?>",4000,initVideoplaza);
			// *** START - videoplaza plugin config ***
			vpConfig = {
				vphost : 'http://th-pmdplus.videoplaza.tv',
				category : 'award',
				tags : ['standard'],
				flags: [],
				playbackPosition: [] // mid-roll cue points, if any.
			}
			// *** END - videoplaza plugin config ***
			//Auto Play && Loop
			$('#my_video').attr('autoplay','autoplay');	
		} else {
			jwplayer("vdoPlayer").setup({
				autostart: true,
		      	flashplayer: "<?php echo js_asset_url('media/player.swf');?>",
		      	width: 640,
		      	height: 390,
				file: ""+url+"",
		      	plugins: "<?php echo js_asset_url('media/vp_plugin.swf');?>",
		      	vpdomain: "http://th-pmdplus.videoplaza.tv",
		      	vpshares: "award",
		      	vptags: ""
			});		
		}		
	});	
})(jQuery);

function playThis(url)
{
		var is_mobile = '<?php echo $this->agent->is_mobile();?>';
		if(is_mobile){	
			//Set Video Source
			$('#my_video').empty().append("<source id='mp4' src='"+url+"' type='video/mp4'>");
			$('#my_video').attr('src',""+url+"");
			$('#my_video').attr('width',640);
			$('#my_video').attr('height',390);		
			// videoplaza sdk, 4 sec time-out, callback function
			loadScript("<?php echo js_asset_url('media/html5-sdk-1.0.12.15.1-ea.min.js');?>",4000,initVideoplaza);
			// *** START - videoplaza plugin config ***
			vpConfig = {
				vphost : 'http://th-pmdplus.videoplaza.tv',
				category : 'award',
				tags : ['standard'],
				flags: [],
				playbackPosition: [] // mid-roll cue points, if any.
			}
			// *** END - videoplaza plugin config ***
			//Auto Play && Loop
			$('#my_video').attr('autoplay','autoplay');			
		} else {
			jwplayer("vdoPlayer").setup({
				autostart: true,
				flashplayer: "<?php echo js_asset_url('media/player.swf');?>",
			 	width: 640,
			 	height: 390,
				file: ""+url+"",
				events: {
					onComplete: function(event) {
						jwplayer().play();
					}
				},
			  	plugins: "<?php echo js_asset_url('media/vp_plugin.swf');?>",
			  	vpdomain: "http://th-pmdplus.videoplaza.tv",
			   	vpshares: "award",
			   	vptags: "",
               	provider: "http",
        		startparam: "starttime"							
			});		
		}	
		//multipleElementsCycle
		$("#slider").multipleElementsCycle({
			scrollCount: 1,
			start: 0,
			jumpTo: '.cycleToPoint',
			auto: true
		});				
}

function voteCat(e,cat,at)
{
	$.ajax({
		url:web_path+'ajax_vote?t='+new Date().getTime(),
		type:'post',
		data:({
			cat:cat,
			at:at
		}),
		dataType:'json'
	}).done(function(data){	
		if(data.error == 1){
			alert('กรุณา Login ด้วย Facebook ก่อนทำการโหวต.');
			//$(document).scrollTop(0);
			$('html, body').animate({
    			scrollTop: 0
 			}, 1000);			
		} else if(data.error == 2){
			alert('คุณมีสิทธิ์ในการโหวตได้ 2 ครั้ง ในหนึ่งชั่วโมง\nคุณสามารถกลับมาโหวตได้อีกครั้งภายในครึ่งชั่วโมง');
		} else if(data.error == 3){
			alert('ขออภัยค่ะ ปิดกิจกรรมการโหวตเรียบร้อยแล้ว');			
		} else {
			//change image to voted
			$(e).attr('class','buttonVoted');
		}
	});
}
</script>